home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
os2
/
fm2_248.zip
/
install.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-07-15
|
48KB
|
1,186 lines
/****************************************************************************
* FM/2 2.x installation program copyright (c) 1993-96 by M. Kimes *
****************************************************************************
* *
* This program creates folders to hold program and data objects, *
* then creates program objects for each executable. It only needs to be *
* run once (unless you move the FM/2 directory -- see say notes at end). *
* Run this program in the FM/2 directory (where you unpacked the archive). *
* *
****************************************************************************
* *
* For unattended installation, call with /UNATTENDED as the first *
* argument. To avoid any WPS associations being set, use the *
* /NOASSOC argument. INSTALL /? for usage help. *
* *
****************************************************************************/
/* Identify ourself */
'@Echo off'
'cls'
say' ┌───────────────────────────────────────────────────────────────────┐'
say' │ FM/2 2.x Installation Program │'
say' │ FM/2 is copyright (c) 1993-96 by M. Kimes │'
say' │ All rights reserved │'
say' ├───────────────────────────────────────────────────────────────────┤'
say' ├───────────────────────────────────────────────────────────────────┤'
say' │ Have you read the READ.ME file yet? │'
say' │ By running this program, you agree to the license │'
say' │ as specified in that file, │'
say' │ and it tells you how to install, so you should read it. │'
say' │ Please? │'
say' └───────────────────────────────────────────────────────────────────┘'
assocfilter = ';ASSOCFILTER=*.ZIP,*.ARC,*.LZH,*.ARJ,*.ZOO,*.MO0,READ.ME,README,README.1ST,README.OS2,REGISTER.TXT'
/* check arguments and adjust as required */
parse upper arg dummy1 dummy2
if dummy1 = '/NOASSOC' then assocfilter = ''
if dummy2 = '/NOASSOC' then assocfilter = ''
if assocfilter = '' then say ' /NOASSOC = TRUE'
if dummy1 = '/UNATTENDED' then unattended = ''
if dummy2 = '/UNATTENDED' then unattended = ''
if unattended = '' then say ' /UNATTENDED = TRUE'
/* if user asked for usage help, give it */
if dummy1 = '/?' | dummy2 = '/?' then
do
say ''
say 'Usage: INSTALL [/NOASSOC] [/UNATTENDED]'
say ' /NOASSOC = don''t set any WPS associations'
say ' /UNATTENDED = don''t ask any questions'
say ''
say 'Examples:'
say ' INSTALL'
say ' INSTALL /NOASSOC'
say ' INSTALL /UNATTENDED'
say ' INSTALL /NOASSOC /UNATTENDED'
exit
end
/* see if we might be in the right directory... */
rc = stream('fm3.exe','c','query exists')
if rc = '' then
do
say 'Sorry, FM3.EXE not found. Must not be right directory. Terminating.'
exit
end
/* tell user what we're doing */
say ''
say 'This program creates objects for FM/2 and does some drudgework for you.'
say ''
/* load rexx utility functions */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
/* give user a chance to hit CTRL-C */
if unattended = 'UNATTENDED' then
do
call charout ,' Press [Enter] to continue...'
dummy = ''
do until dummy = '0d'x
dummy = SysGetKey('NOECHO')
end
call charout ,'0d1b'x'[K'
end
/* save current directory */
curdir = directory()
/* say it, then do it */
say "Creating File Manager/2 folders and objects..."
/* first, create FM/2 folder */
rc = stream('fm2fldr.ico','c','query exists')
title = "File Manager/2"
classname = 'WPFolder'
location = '<WP_DESKTOP>'
setup = 'OBJECTID=<FM3_Folder>;OPEN=DEFAULT'
if rc \= '' then setup = setup';ICONFILE='rc
result = SysCreateObject(classname,title,location,setup,f)
if unattended = 'UNATTENDED' then
do
if result = 0 then
do
assocfilter = ''
existed = ''
say ''
say 'The File Manager/2 folder already exists.'
call charout ,"Should I update the objects (it's painless)? (Y/N) "
dummy = ''
do forever
dummy = SysGetKey('NOECHO')
parse upper var dummy dummy
if dummy = '1b'x then dummy = 'N'
if dummy = '0d'x then dummy = 'Y'
if dummy = 'N' then leave
if dummy = 'Y' then leave
end
call charout ,dummy
say ''
if dummy = 'N' then exit
end
end
else
do
if result = 0 then
do
assocfilter = ''
existed = ''
say 'Updating objects.'
end
end
/* create objects in appropriate folders */
rc = stream('fm3.exe','c','query exists')
if rc \= '' then
do
title = "FM/2"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'OBJECTID=<FM/2>;EXENAME='rc';STARTUPDIR='curdir
if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('fm4.exe','c','query exists')
if rc \= '' then
do
title = "FM/2 Lite"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'OBJECTID=<FM/2 LITE>;EXENAME='rc';STARTUPDIR='curdir
if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
/* create toolbox folder in FM/2 folder */
rc = stream('toolbox.ico','c','query exists')
title = "FM/2 Tools"
classname = 'WPFolder'
location = '<FM3_Folder>'
setup = 'OBJECTID=<FM3_Tools>;OPEN=DEFAULT'
if rc \= '' then setup = setup';ICONFILE='rc
result = SysCreateObject(classname,title,location,setup,u)
rc = stream('av2.exe','c','query exists')
if rc \= '' then
do
title = "Archive Viewer/2"
classname = 'WPProgram'
location = '<FM3_Tools>'
setup = 'OBJECTID=<FM/2_AV/2>;EXENAME='rc';STARTUPDIR='curdir''assocfilter
if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('eas.exe','c','query exists')
if rc \= '' then
do
title = "EA Viewer"
classname = 'WPProgram'
location = '<FM3_Tools>'
setup = 'OBJECTID=<FM/2_EAVIEW>;EXENAME='rc';STARTUPDIR='curdir
if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('dirsize.exe','c','query exists')
if rc \= '' then
do
title = "Dir Sizes"
classname = 'WPProgram'
location = '<FM3_Tools>'
setup = 'OBJECTID=<FM/2_DIRSIZE>;EXENAME='rc';STARTUPDIR='curdir
if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('makearc.exe','c','query exists')
if rc \= '' then
do
title = "Make Archive"
classname = 'WPProgram'
location = '<FM3_Tools>'
setup = 'OBJECTID=<FM/2_MAKEARC>;EXENAME='rc';STARTUPDIR='curdir
if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('ini.exe','c','query exists')
if rc \= '' then
do
if assocfilter \= '' then assocfilter = ';ASSOCFILTER=*.INI'
title = "INI Viewer"
classname = 'WPProgram'
location = '<FM3_Tools>'
setup = 'OBJECTID=<FM/2_INIVIEW>;EXENAME='rc';STARTUPDIR='curdir''assocfilter
if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('viewinfs.exe','c','query exists')
if rc \= '' then
do
title = "Bookshelf Viewer"
classname = 'WPProgram'
location = '<FM3_Tools>'
setup = 'OBJECTID=<FM/2_BOOKSHELF>;EXENAME='rc';STARTUPDIR='curdir
call SysCreateObject classname,title,location,setup,u
title = "Helpfile Viewer"
classna